home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / doc / signal / macros / casc.sci
Text File  |  1999-09-16  |  1KB  |  37 lines

  1. //<cels>=casc(x,z)
  2. //<cels>=casc(x,z)
  3. //Creates cascade realization of filter
  4. //from a matrix of coefficients
  5. //  x    :(4xN)-Matrix where each column is a cascade
  6. //       :element, the first two column entries being
  7. //       :the numerator coefficients and the second two
  8. //       :column entries being the denominator coefficients
  9. //  z    :Character string representing the cascade variable
  10. //  cels :Resulting cascade representation
  11. //
  12. //EXAMPLE:
  13. //  <> x         =
  14. //
  15. //  !   1.     2.     3.  !
  16. //  !   4.     5.     6.  !
  17. //  !   7.     8.     9.  !
  18. //  !   10.    11.    12. !
  19. //
  20. //  <>cels=casc(x,'z')
  21. //  cels      =
  22. //
  23. //  !             2               2               2  !
  24. //  !   1 + 4z + z      2 + 5z + z      3 + 6z + z   !
  25. //  !  ------------    ------------    ------------  !
  26. //  !              2               2               2 !
  27. //  !   7 + 10z + z     8 + 11z + z     9 + 12z + z  !
  28. //!
  29. //author: F. Delebecque  date: August 1988
  30.    cels=[];
  31.    for col=x,
  32.       nf=[col(1:2);1];
  33.       nd=[col(3:4);1];
  34.       cels=[cels,list('r',poly(nf,'z','c'),poly(nd,'z','c'),[])];
  35.    end,
  36. //end
  37.